#!/bin/bash

echo "=== 测试改进的多表联查功能 ==="
cd /Users/zhangpeng/Desktop/150/storage_system_cpp

# 清理旧的数据库文件
rm -f data.db index.db

echo "创建测试数据..."

echo "3
users
4
users
1
Alice,25,Engineer
4
users
2
Bob,30,Manager
4
users
3
Charlie,28,Developer
3
orders
4
orders
1
Order1,100.50
4
orders
2
Order2,75.25
4
orders
3
Order3,200.00
13
users orders
1
users.id = orders.id
0" | ./interactive_demo

echo ""
echo "测试完成！"
echo ""
echo "现在支持的JOIN类型："
echo "1. INNER JOIN - 只返回匹配的记录"
echo "2. LEFT JOIN - 返回左表所有记录，右表匹配记录"
echo "3. RIGHT JOIN - 返回右表所有记录，左表匹配记录"
echo "4. FULL JOIN - 返回两个表的所有记录"
echo "5. CROSS JOIN - 笛卡尔积（无条件连接）"
echo ""
echo "连接条件格式：table1.column = table2.column"
echo "例如：users.id = orders.user_id"
